package 多线程.多线程;

import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;

public class OtherMethod {
    public static void main(String[] args) {
//        Thread thread = new Thread(){
//            @Override
//            public void run() {
//                System.out.println("匿名内部类的线程");
//                System.out.println(Thread.currentThread().getName());
//            }
//        };
//        thread.start();
//        System.out.println("主线程的线程");
//        System.out.println(Thread.currentThread().getName());

        Runnable runnable = new Runnable() {
            @Override
            public void run() {
                System.out.println("Runnable的线程");
                System.out.println(Thread.currentThread().getName());
            }
        };
        Thread thread = new Thread(runnable);
        thread.start();
        System.out.println("主线程");
        System.out.println(Thread.currentThread().getName());
        Thread thread1 = new Thread(() -> System.out.println("Lambda表达式的写法"));
        thread1.start();
    }
}
